var mongoose = require('mongoose');
var author = require('./author');
var colmun = require('./colmun');
var Schema = mongoose.Schema;
var bookModel = new Schema({
    name: String,
    money: String,
    author_id: {
        type: Schema.Types.ObjectId,
        ref: 'author'
    },
    aboutBook: String,
    creareDate: {
        type: String,
        default: new Date().toLocaleString(),
    },
    shoucang: {
        type: Number,
        default: 0
    },
    img: {
        type: String,
        default: ''
    },
    colmun_id: {
        type: Schema.Types.ObjectId,
        ref: 'colmun'
    },
    sort:{
        type:String,
        default: Date.parse(new Date()),
    }
})
module.exports = mongoose.model('book', bookModel)